package com.example.design_pattern.state;

import com.example.design_pattern.exception.WallEntryException;

public class Client {


    public static void main(String[] args){
        Client client = new Client();
        client.test2();
    }

    private void test1(){
        WallEntry wallEntry = new WallEntry();
        wallEntry.setmWallState(new LockedState());
        try {
            //wallEntry.pass();
            //wallEntry.spell("hh");
            wallEntry.spell("123456");
            wallEntry.pass();
        } catch (WallEntryException e) {
            e.printStackTrace();
        }
    }

    private void test2(){
        WallEntry wallEntry = new WallEntry();
        wallEntry.setmWallState(new UnlockedState());
        try {
            //wallEntry.spell("");
            wallEntry.pass();
            //wallEntry.spell("hh");
            wallEntry.spell("123456");
            wallEntry.pass();
        } catch (WallEntryException e) {
            e.printStackTrace();
        }
    }
}
